<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
</head>
<body>
<h1>登录</h1>
<div th:if="${param.error}">用户名或密码错误</div>

<!--
使用动态参数，th:action="@{/login}"
开启防止csrf攻击时，会自动生成_csrf隐藏字段
 -->

<form th:action="@{/login}" method="post">
    <div>
        <input type="text" name="myusername" placeholder="用户名">
    </div>
    <div>
        <input type="password" name="mypassword" placeholder="密码">
    </div>
    <input type="submit" value="登录">
</form>
</body>
</html>